package com.taobao.action.ui;

import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;

import com.taobao.action.CommonAction;
import com.taobao.ui.widget.CommonWidget;

public class MouseDoubleClickAction implements MouseListener {

    private CommonAction action;

    private CommonWidget commonWidget;

    private Object sourceObject;

    public MouseDoubleClickAction(CommonAction action, CommonWidget commonWidget, Object sourceObject) {
        this.action = action;
        this.commonWidget = commonWidget;
        this.sourceObject = sourceObject;
    }

    @Override
    public void mouseDoubleClick(MouseEvent e) {
        action.setData("source", sourceObject);
        action.doAction(commonWidget);
    }

    @Override
    public void mouseDown(MouseEvent e) {
        
    }

    @Override
    public void mouseUp(MouseEvent e) {
    }

}
